<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        <p:commandButton id="chartBtn" value="Basic" type="button" />
        <p:overlayPanel for="chartBtn">
            <p:chart type="pie" model="#{pieBean.model}" style="width:400px;height:300px" />
        </p:overlayPanel>
        
        <p:commandButton id="secondBtn" value="Basic" type="button" />
        <p:overlayPanel for="secondBtn" showEvent="mouseover" hideEvent="mousedown">
            <p:chart type="pie" model="#{pieBean.model}" style="width:400px;height:300px" />
        </p:overlayPanel>
    </h:body>
</html>
